<?php
/**
  * Mar 6, 2008
  *
  * Coded by: Ropu
  *
  */

?>

<style type="text/css">

td.error {
  color: red;
  font-size:13px;
  text-align:center;
}
body {
   font-family:verdana,arial;
}
table.canvas_table
{
  empty-cells: show;
  border-collapse: collapse;
  border: thin inset rgb(100,100,100);  
  background-color: rgb(255,255,255);
  text-align:left;
  vertical-align: middle;
  width:100%;
}
input.button
{
  border: thin outset rgb(100,100,100);
  background-color: rgb(220,220,220)
}
h2
{
  text-align:center;
  font-family:verdama;
  font-size:16px;
  overflow:hidden;
}
th
{
  font-family:verdama;
  font-size:14px;overflow:hidden;
}
a:hover {
  text-decoration:underline;
}
a {
  color:#3B5998;
  text-decoration:none;
}
div.table_title {
  text-align:center;
  font-family:verdama;
  font-size:20px;
  overflow:hidden;
  height:25px;
  vertical-align: bottom;
}
div.table_subtitle {
  text-align:center;
  font-family:verdama;
  font-size:16px;
  overflow:hidden;
  height:18px;
  vertical-align: bottom;
}
div.app_description {
  font-family:verdama;
  font-size:14px;
  overflow:auto;
  vertical-align: bottom;
}
div.template_body {
  vertical-align: top;
  width:100%;
}
</style>
<div id='white_div' style="margin-top:45px;">
<div class="template_body">
  <div class="table_title">
    <?=sprintf($lang['profile']['applications_list'], $name) ;?>
  </div>
<?php
if(count($apps)) {
  foreach($apps as $app) {
?>
  <table class="canvas_table" id="app">
     <tr>
       <td style="width: 100px;">
         <?=$lang['appedit']['title'];?>
       </td>
       <td>
         <b><?=$app->getTitle();?></b>
       </td>
     </tr>
     <tr>
       <td>
         <?=$lang['appedit']['description'];?>
       </td>
       <td>
         <div class="app_description"><?=$app->getDescription();?></div>
       </td>
     </tr>
	</table>
  <table class="canvas_table" id="app">
     <tr>
       <td style="font-size:14px;">
         <?=$lang['profile']['url'];?>
         <input onclick="this.select();" onblur="this.value='<?=htmlentities($app->getLastVersion()->getUrl());?>'" style="width: 90%;" type="text" value="<?=htmlentities($app->getLastVersion()->getUrl());?>"/>
       </td>
<?php
  $f = isset($my_fav_apps[$app->getId()])?true:false;
?>
      <td width="130" id="add_favorite_<?=$app->getId();?>" style="display:<?=$f?'none':'';?>">
        <input type="button" onclick="add_favorite('<?=$app->getId();?>');" value="<?=$lang['profile']['add_favorite'];?>" />   
      </td>
      <td width="130" id="rem_favorite_<?=$app->getId();?>" style="display:<?=$f?'':'none';?>">
        <input type="button" onclick="rem_favorite('<?=$app->getId();?>');" value="<?=$lang['profile']['rem_favorite'];?>" />   
      </td>

     </tr>
  </table><br />
<?php
  }
} else {
?>
  <table style="width: 100%;">
     <tr>
       <td style="text-align: center;">
         <?=$lang['profile']['no_apps_yet'];?>
       </td>
     </tr>
  </table>
<?php  
}
?>
<?php
if(count($rec_apps)) {
?>
  <div class="table_title">
    <?=sprintf($lang['profile']['favorite_applications_list'], $name) ;?>
  </div>

<?php
  foreach($rec_apps as $app) {
    $h = new Hacker($app->getHackerId());
   
?>
  <table class="canvas_table" id="app">
    <tr>
      <td width="50px" rowspan="4">
        <div class="hacker_thum" style="text-align: center;font-size: 10px;">
          <a href="javascript:goToUrl('profile.php?id=<?=$h->getId();?>');void(0);">
            <img onError="this.onerror=''; this.src='http://images.hi5.com/images/nophoto_boy_100.gif'" src="<?=$h->getPicture();?>" border="0" style="height:50px;width:50px"/><br />
            <?=$h->getNickname();?>
          </a>
        </div>
      </td>
     </tr>
     <tr>
       <td style="width: 100px;">
         <?=$lang['appedit']['title'];?>
       </td>
       <td>
         <b><?=$app->getTitle();?></b>
       </td>
     </tr>
     <tr>
       <td>
         <?=$lang['appedit']['description'];?>
       </td>
       <td>
         <div class="app_description"><?=$app->getDescription();?></div>
       </td>
     </tr>
     <tr>
       <td colspan="2" style="font-size:14px;">
         <?=$lang['profile']['url'];?>
         <input onclick="this.select();" style="width: 90%;" type="text" value="<?=htmlentities($app->getLastVersion()->getUrl());?>"/>
       </td>
     </tr>
  </table><br />
<?php
  }
}
?>
</div>